package com.ybwh.springboot2.common;

import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 业务异常,用于service给上层返回业务上错误信息
 * </p>
 *
 * @author fanbeibei
 * @version V1.0
 * @since 2019/6/12 9:44
 */
@Getter
@Setter
public class BusinessException extends Exception {
    private Object data;

    public BusinessException() {
        super();
    }

    public BusinessException(String msg) {
        super(msg);
    }
    public BusinessException(String msg,Object data) {
        super(msg);
        this.data = data;
    }

    protected BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    protected BusinessException(Throwable cause) {
        super(cause);
    }

    protected BusinessException(String message, Throwable cause,
                                boolean enableSuppression,
                                boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }


    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}
